#directory definations

# @NOTICE : your project's home
DIR_PROJECT         = $(HOME)/project/

# @NOTICE : should change this path for log4cplus
DIR_LOG4CPLUS  = /usr/local/

DIR_INCLUDE    = /usr/local/include
DIR_LIBRARY    = /usr/local/lib

DIR_MYSQL      = /usr/local/mysql

DIR_LOCAL_LIB       = $(DIR_LOG4CPLUS)/lib
DIR_LOCAL_INC       = $(DIR_LOG4CPLUS)/include/

DIR_PROJECT_LIBS    = $(DIR_PROJECT)/libs/

DIR_THIRD           = $(DIR_PROJECT)/third_lib/

# INCLUDE
INC_PROJECT_LIBS    = -I$(DIR_PROJECT_LIBS)/buffer -I$(DIR_PROJECT_LIBS)/socket \
					 -I$(DIR_PROJECT_LIBS)/thread -I$(DIR_PROJECT_LIBS)/common \
					 -I$(DIR_PROJECT_LIBS)/app

INC_PROJECT         = -I$(DIR_PROJECT)/common/ -I$(DIR_PROJECT)/protocol/

INC_LOG4CPLUS       = -I$(DIR_LOCAL_INC)

INC_MYSQL           = -I$(DIR_MYSQL)/include

INC_THIRD           = -I$(DIR_THIRD)

# LIB
LIB_LIBRARY         = -L$(DIR_LIBRARY) -pthread

LIB_PROJECT_LIBS    = -L$(DIR_PROJECT_LIBS) -lsocket -lthread -lapp

LIB_PROJECT         = -L$(DIR_PROJECT)/protocol/ -lprotocol -L$(DIR_PROJECT)/common/ -lcommon 

LIB_LOG4CPLUS       = -L$(DIR_LOCAL_LIB) -llog4cplus

LIB_MYSQL           = -L$(DIR_MYSQL)/lib -lmysqlclient_r 

LIB_THIRD           = -L$(DIR_THIRD)/ -lthird

#command definations
EXTRAFLAGS     = -g -Wall -ftemplate-depth-50 -fpermissive -fPIC -Wno-deprecated \
				 -D_DEBUG -D_LOG4CPLUS

INCLUDES       = $(INC_LOG4CPLUS) $(INC_MYSQL) $(INC_PROJECT_LIBS) $(INC_PROJECT) $(INC_THIRD)

BASE_LIBS      = $(LIB_LIBRARY) $(LIB_LOG4CPLUS) $(LIB_PROJECT_LIBS) $(LIB_PROJECT) $(LIB_MYSQL) $(LIB_THIRD)

CXXFLAGS       = $(INCLUDES) $(EXTRAFLAGS)

MAKE           = make
CXX            = g++
LEX            = flex
YACC           = bison
MV             = mv -f
RM             = rm -f
CP             = cp -f
AR             = ar rc

#rule definations
.SUFFIXES:  .cxx
.cpp.o:
	$(CXX) -o $@ -c $< $(CXXFLAGS)
.cxx.o:
	$(CXX) -o $@ -c $< $(CXXFLAGS)
.cc.o:
	$(CXX) -o $@ -c $< $(CXXFLAGS)


